
//? 闭包
Array.prototype.myInterator2 = function () {
    let i = 0
    return {
        next : () => {
            return {
                value : arr[i++],
                done : i >= this.length
            }
        }
    }
}
let arr = ["213", "asd", 2, 3, 14];
let b = arr.myInterator2()
console.log(b.next());
console.log(b.next());
console.log(b.next());
console.log(b.next());
console.log(b.next());
console.log(b.next());

